Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use typeof() to detect data type #95

Merged
merged 3 commits into from Feb 10, 2016
Merged

Use typeof() to detect data type #95

merged 3 commits into from Feb 10, 2016

Conversation

krlmlr
Copy link
Member

@krlmlr krlmlr commented Feb 9, 2016

instead of class().

From https://github.com/krlmlr/bigrquery/commit/50a1ff03afefa86dc7f7e4ef0bb0b8de294e5c81#commitcomment-15959160:

this will give better default behaviour for base vectors with classes that we don't know how to deal with otherwise.

POSIXct = "TIMESTAMP",
stop("Unknown class ", paste0(class(x), collapse = "/"))
if (is.factor(x)) return("STRING")
if (inherits(x, "POSIXct")) return("TIMESTAMP")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should test for "POSIXt"

hadley added a commit that referenced this pull request Feb 10, 2016
@hadley hadley merged commit b4f438b into r-dbi:master Feb 10, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants